package com.lvshou.medicalkit;

import android.app.Application;
import android.content.Context;

import com.common.libhttp.retrofit.RetrofitManager;
import com.lvshou.medicalkit.constants.Constants;
import com.lvshou.medicalkit.service.InitializeService;
import com.lvshou.medicalkit.utils.BleUtil;
import com.squareup.leakcanary.LeakCanary;

import androidx.multidex.MultiDex;

/**
 * Application
 *
 * @author Administrator
 * @Date 2019/3/6
 */
public class MainApplication extends Application {

    private static MainApplication instance;

    public static MainApplication getInstance() {
        return instance;
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }


    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        if (LeakCanary.isInAnalyzerProcess(this)) {
            // This process is dedicated to LeakCanary for heap analysis.
            // You should not init your app in this process.
            return;
        }

        LeakCanary.install(this);
        RetrofitManager.getInstance().setBaseUrl(Constants.BASE_URL).init(this);
        InitializeService.start(this);


    }
}
